package com.hnkywl.sts.entity.sys;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.base.Dxpz;
import com.hnkywl.sts.entity.organ.Ck;
import com.hnkywl.sts.entity.organ.Gsjg;
import com.hnkywl.sts.entity.organ.Nbbm;
import com.hnkywl.sts.entity.organ.Nbgs;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 员工
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-3-2
 * Time: 下午2:30
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="T_SYS_YG")
@Where(clause = "deleted!='1'")
public class Yg extends BaseEntity{
    @Id
    @SequenceGenerator(name = "seqYg", allocationSize = 1, sequenceName = "SEQ_SYS_YG")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqYg")
    private Long id;
    /**
     * 员工工号
     */
    private String gh;
    /**
     * 员工姓名
     */
    private String xm;
    /**
     * 员工直属上级
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZSSJ_ID")
    @Where(clause = "deleted!='1'")
    private Yg zssj;

    /**
     * 直属上级的反向用于删除判断
     */
    @OneToMany(mappedBy = "zssj", cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Yg.class)
    @Where(clause = "deleted!='1'")
    @OrderBy("pxh asc,dateCreated desc ")
    private List<Yg> ygList;

    /**
     * 部门经理的反向关联，用于删除判断
     */
    @OneToMany(mappedBy = "bmjl", cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Nbbm.class)
    @Where(clause = "deleted!='1'")
    @OrderBy("pxh asc,dateCreated desc ")
    private List<Nbbm> bmjlList;


    /**
     * 日常管理的反向关联，用于删除判断
     */
    @OneToMany(mappedBy = "rcgl", cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Nbbm.class)
    @Where(clause = "deleted!='1'")
    @OrderBy("pxh asc,dateCreated desc ")
    private List<Nbbm> rcglList;
    /**
     * 员工所属机构
     */
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name="T_SYS_YG_GSJG", joinColumns={@JoinColumn(name="YG_ID")},inverseJoinColumns={@JoinColumn(name="GSJG_ID")})
    @Where(clause = "deleted!='1'")
    private List<Gsjg> ssjgList;
    /**
     * 员工主管机构
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZGJG_ID")
    @Where(clause = "deleted!='1'")
    private Gsjg zgjg;
    /**
     * 员工主管公司
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZGGS_ID")
    @Where(clause = "deleted!='1'")
    private Gsjg zggs;

    /**
     * 员工用工性质
     */
    private Integer ygxz;
    /**
     * 员工主要岗位
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZYGW_ID")
    @Where(clause = "deleted!='1'")
    private Gw zygw;
    /**
     * 员工所属岗位
     */
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "T_SYS_YG_SSGW", joinColumns={@JoinColumn(name="YG_ID")},inverseJoinColumns={@JoinColumn(name="GW_ID")})
    @Where(clause = "deleted!='1'")
    private List<Gw> ssgwList;
    /**
     * 员工职称
     */
    private Integer zc;
    /**
     * 员工政治面貌
     */
    private Integer zzmm;
    /**
     * 员工民族
     */
    private Integer mz;
    /**
     * 员工性别
     */
    private Integer xb;
    /**
     * 员工出生日期
     */
    private Date csrq;
    /**
     * 查询范围 0 =全部  1=本公司  2 =本部门  3=本人
     */
    private  Integer cxfw;

    private String csd;//出生地

    private String hjdz; //户籍地址

    private Boolean hyzk;//婚姻状况

    private String gzfjh; //工作分机号

    private String dhhm; //电话号码

    private String sgzk; //身体状况

    private Float sg; //身高

    private Float tz; // 体重

    private Integer xx; // 血型

    private String ywah;   //业务爱好

    private String tc; //特长

    private String dah;  //档案号

    private Date rzsj;   //入职时间

    private String cwbh;  //财务编号

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name="T_SYS_YG_JS", joinColumns={@JoinColumn(name="YG_ID")},inverseJoinColumns={@JoinColumn(name="JS_ID")})
    @Where(clause = "deleted!='1'")
    private List<Js> jsList;   //角色

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name="T_SYS_YG_CK", joinColumns={@JoinColumn(name="YG_ID")},inverseJoinColumns={@JoinColumn(name="CK_ID")})
    @Where(clause = "deleted!='1'")
    private List<Ck> ckList;   //仓库

    private Boolean sfzz;    //是否在职

    private Boolean kdl;   //可登录

    private String dlm;    //登录名

    private String dlmm;    //登录密码

    private Integer pxh;    //排序号

    private String kmdm;    //科目代码

    private String jqdlm;//jiuqi登录名

    private String jqdlmm;//jiuqi登录密码
    


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGh() {
        return gh;
    }

    public void setGh(String gh) {
        this.gh = gh;
    }

    public String getXm() {
        return xm;
    }

    public void setXm(String xm) {
        this.xm = xm;
    }

    public Yg getZssj() {
        return zssj;
    }

    public void setZssj(Yg zssj) {
        this.zssj = zssj;
    }

    public List<Gsjg> getSsjgList() {
        return ssjgList;
    }

    public void setSsjgList(List<Gsjg> ssjgList) {
        this.ssjgList = ssjgList;
    }

    public Gsjg getZgjg() {
        return zgjg;
    }

    public void setZgjg(Gsjg zgjg) {
        this.zgjg = zgjg;
    }

    public Gsjg getZggs() {
        return zggs;
    }

    public void setZggs(Gsjg zggs) {
        this.zggs = zggs;
    }

    public Integer getYgxz() {
        return ygxz;
    }

    public void setYgxz(Integer ygxz) {
        this.ygxz = ygxz;
    }

    public Gw getZygw() {
        return zygw;
    }

    public void setZygw(Gw zygw) {
        this.zygw = zygw;
    }

    public List<Gw> getSsgwList() {
        return ssgwList;
    }

    public void setSsgwList(List<Gw> ssgwList) {
        this.ssgwList = ssgwList;
    }

    public Integer getZc() {
        return zc;
    }

    public void setZc(Integer zc) {
        this.zc = zc;
    }

    public Integer getZzmm() {
        return zzmm;
    }

    public void setZzmm(Integer zzmm) {
        this.zzmm = zzmm;
    }

    public Integer getMz() {
        return mz;
    }

    public void setMz(Integer mz) {
        this.mz = mz;
    }

    public Integer getXb() {
        return xb;
    }

    public void setXb(Integer xb) {
        this.xb = xb;
    }

    public Date getCsrq() {
        return csrq;
    }

    public void setCsrq(Date csrq) {
        this.csrq = csrq;
    }

    public String getCsd() {
        return csd;
    }

    public void setCsd(String csd) {
        this.csd = csd;
    }

    public String getHjdz() {
        return hjdz;
    }

    public void setHjdz(String hjdz) {
        this.hjdz = hjdz;
    }

    public Boolean getHyzk() {
        return hyzk;
    }

    public void setHyzk(Boolean hyzk) {
        this.hyzk = hyzk;
    }

    public String getGzfjh() {
        return gzfjh;
    }

    public void setGzfjh(String gzfjh) {
        this.gzfjh = gzfjh;
    }

    public String getDhhm() {
        return dhhm;
    }

    public void setDhhm(String dhhm) {
        this.dhhm = dhhm;
    }

    public String getSgzk() {
        return sgzk;
    }

    public void setSgzk(String sgzk) {
        this.sgzk = sgzk;
    }

    public Float getSg() {
        return sg;
    }

    public void setSg(Float sg) {
        this.sg = sg;
    }

    public Float getTz() {
        return tz;
    }

    public void setTz(Float tz) {
        this.tz = tz;
    }

    public Integer getXx() {
        return xx;
    }

    public void setXx(Integer xx) {
        this.xx = xx;
    }

    public String getYwah() {
        return ywah;
    }

    public void setYwah(String ywah) {
        this.ywah = ywah;
    }

    public String getTc() {
        return tc;
    }

    public void setTc(String tc) {
        this.tc = tc;
    }

    public String getDah() {
        return dah;
    }

    public void setDah(String dah) {
        this.dah = dah;
    }

    public Date getRzsj() {
        return rzsj;
    }

    public void setRzsj(Date rzsj) {
        this.rzsj = rzsj;
    }

    public String getCwbh() {
        return cwbh;
    }

    public void setCwbh(String cwbh) {
        this.cwbh = cwbh;
    }

    public List<Js> getJsList() {
        return jsList;
    }

    public void setJsList(List<Js> jsList) {
        this.jsList = jsList;
    }

    public Boolean getSfzz() {
        return sfzz;
    }

    public void setSfzz(Boolean sfzz) {
        this.sfzz = sfzz;
    }

    public Boolean getKdl() {
        return kdl;
    }

    public void setKdl(Boolean kdl) {
        this.kdl = kdl;
    }

    public String getDlm() {
        return dlm;
    }

    public void setDlm(String dlm) {
        this.dlm = dlm;
    }

    public String getDlmm() {
        return dlmm;
    }

    public void setDlmm(String dlmm) {
        this.dlmm = dlmm;
    }

    public Integer getPxh() {
        return pxh;
    }

    public void setPxh(Integer pxh) {
        this.pxh = pxh;
    }

    public List<Nbbm> getBmjlList() {
        return bmjlList;
    }

    public void setBmjlList(List<Nbbm> bmjlList) {
        this.bmjlList = bmjlList;
    }

    public List<Nbbm> getRcglList() {
        return rcglList;
    }

    public void setRcglList(List<Nbbm> rcglList) {
        this.rcglList = rcglList;
    }

    public List<Yg> getYgList() {
        return ygList;
    }

    public void setYgList(List<Yg> ygList) {
        this.ygList = ygList;
    }

    public Integer getCxfw() {
        return cxfw;
    }

    public void setCxfw(Integer cxfw) {
        this.cxfw = cxfw;
    }

    public String getKmdm() {
        return kmdm;
    }

    public void setKmdm(String kmdm) {
        this.kmdm = kmdm;
    }

    public String getJqdlm() {
        return jqdlm;
    }

    public void setJqdlm(String jqdlm) {
        this.jqdlm = jqdlm;
    }

    public String getJqdlmm() {
        return jqdlmm;
    }

    public void setJqdlmm(String jqdlmm) {
        this.jqdlmm = jqdlmm;
    }

    public List<Ck> getCkList() {
        return ckList;
    }

    public void setCkList(List<Ck> ckList) {
        this.ckList = ckList;
    }


}
